package com.trade.data.type;

public enum MovingAveragePeriodTypes {
	MA_5(5, "MA 5"),
	MA_9(9, "MA 9"),
	MA_12(12, "MA 12"),
	MA_20(20, "MA 20"),
	MA_26(26, "MA 26"),
	MA_50(50, "MA 50"),
	MA_100(100,"MA 100"),
	MA_200(200, "MA 200") ;

	int id;
	String name;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	MovingAveragePeriodTypes(int id, String name) {
		this.id = id;
		this.name = name;
	}

	public static MovingAveragePeriodTypes getByValue(int value) {
		for (MovingAveragePeriodTypes type : MovingAveragePeriodTypes.values()) {
			if (type.getId() == value ) {
				return type;
			}
		}
		return null;
	}

}